<template>
  <basic-container v-loading="loading">
    <transition name="search">
      <div class="micro-workflow-con" v-if="this.baseUrl&&!errorObj">
        <micro-app :name='pageName'
                   :key="pageName"
                   :data="{commonApi:commonApi,templateList:templateList,functionObj:functionObj,reload:reload}"
                   :inline="true"
                   style="height: 100%"
                   :url='baseUrl'
                   @mounted='microMounted'
                   @datachange="dataChange"
                   @error="microError"
                   baseroute='/micro-workflow/'>
        </micro-app>
      </div>
      <div v-else style="font-size: 22px;color: red;padding: 20px">
        Error：{{errorObj.message}}
      </div>
    </transition>
  </basic-container>
</template>

<script>
import subAppMixins from "../../util/subAppMixins";

export default {
  name: "microWorkflow",
  mixins: [subAppMixins],
  data() {
    return {
      baseUrl: window.location.origin + "/workflowBase/",
      reload: false,
      replaceCode: "micro-workflow"
    }
  },
};
</script>

<style lang="scss" scoped>
.micro-workflow-con {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;

  &::-webkit-scrollbar {
    width: 0;
  }
}

.basic-container {
  ::v-deep .el-card {
    .el-card__body {
      padding: 0;
    }
  }
}
</style>
